<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<style>

body {
	margin: 0;
}

h1 {
	margin: 0;
}

.login {
	width: 480px;
	background-color: rgba(235, 235, 235, 0.85);
	box-shadow: 0px 3px 18px 0px rgba(7, 0, 2, 0.69);
	margin: 0 auto;
	position: relative;
	border-radius: 6px;
	padding-bottom: 40px;
	/*padding-top: 40px;*/
	/*margin-top: 8%;*/
}

.content {
	width: 84%;
	height: 40px;
	line-height: 40px;
	margin-left: 40px;
	color: #666;
	font-size: 14px;
	background-color: white;
	border-radius: 4px;
	margin-top: 30px;
	position: relative;
	border: none;
}
.login input {
	padding-left: 10px;
}
</style>
<script src="${ctx }/res/hplus/js/jquery.min.js?v=2.1.4"></script>
<script src="${ctx }/res/ws/js/jquery-validation-1.13.1/lib/jquery.form.js"></script>
<script src="${ctx }/res/hplus/js/plugins/layer/layer.min.js"></script>
</head>

<body>
	<form action="${ctx }/j_spring_security_check" method="post" id="loginForm" style="display2: none;">
	<div class="login">
		<h1 style="text-align: center; font-size: 20px; padding-bottom: 40px">用户登录</h1>
		<input type="text" name="j_username"
			value="" placeholder="用户名/手机号"
			class="content" style="margin-top: 0" id="username"> 
		<input type="password"
			placeholder="密码" name="j_password"
			class="content" id="password"> 
			<input type="button" class="content"
			style="text-align: center; color: #fff; background-color: #ED145B;"
			value="登录" id="login">
	</div>
	</form>
	
	<script>
		$('#login').click(function() {
			var f = $('#loginForm');
	    	f.ajaxSubmit({
	    		success: function(data) {
	    			$.ajax({
	    				url: "${ctx}/isLogined",
	    				dataType: "json",
	    				success: function(data) {
	    					if (data.success) {
	    						layer.msg('登陆成功，请重新保存!',{time: 1000, icon:6,shade: [0.5, '#f5f5f5']});
	    						setTimeout(function() {
	    							parent.layer.closeAll()
	    								}, 
	    								1000);
	    						
	    					} else {
	    						layer.msg('用户名或密码错误!',{time: 1000, icon:2,shade: [0.5, '#f5f5f5']});
	    					}
	    				}
	    			});
	    		}
	    	});
		});
	</script>
</body>
</html>
